//
//  RewardCell.m
//  ImGuider
//
//  Created by 李陆涛 on 2018/1/23.
//  Copyright © 2018年 imguider. All rights reserved.
//

#import "RewardCell.h"

@interface RewardCell ()

@property (weak, nonatomic) IBOutlet UILabel *levelLabel;

@end


@implementation RewardCell

- (void)setLevel:(RewardModel *)level {
    
    _level = level;
    
    NSString *text = [NSString stringWithFormat:@"%@%@",level.amount,MYLocalizedString(@"PUBLIC_COIN_NAME", nil)];
    
    NSRange range = [text rangeOfString:level.amount];
    
    NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:text];
    attr.font = Font(12);
    attr.color = kContentColor;
    
    [attr addAttribute:NSForegroundColorAttributeName value:kThemeColor range:range];
    [attr addAttribute:NSFontAttributeName value:Font(18) range:range];
    
    self.levelLabel.attributedText = attr;
    
}


- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.contentView.layer.borderWidth = 2.0;
    self.contentView.layer.borderColor = kBGColor.CGColor;
}


- (void)setIsSelect:(BOOL)isSelect {
    
    _isSelect = isSelect;
    self.contentView.layer.borderColor = isSelect ? kThemeColor.CGColor:kBGColor.CGColor;
}


@end
